public class slider {
 
    public SliderDemo__c d;        
 
    public slider(ApexPages.StandardController controller){        
        d = (SliderDemo__c )controller.getRecord();             
    }        
 
    public PageReference save(){        
        upsert d;
        return new PageReference('/'+ d.Id);        
    }
}